1
general::
A person who is dependable in good times but is not in times of trouble. For example, You can't rely on Sarah? she's strictly a fair-weather friend. This expression likens fair weather to good times. [Early 1700s]
American Heritage Idioms
2
general::
Phrase(s): fair-weather friend
Fig. someone who is your friend only when things are pleasant or going well for you. • Bill stayed for lunch but he wouldn’t help me with the yard work. He’s just a fair-weather friend. • A fair-weather friend isn’t much help in an emergency.
McGrawhill's American Idioms And Phrasal Verbs